home *** CD-ROM | disk | FTP | other *** search
- <!--#include file="wmsConstants.inc"-->
- <!--#include file="wmsCommon.inc"-->
- <!--#include file="wmsConnect.inc"-->
- <!--#include file="wmsHelp.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: plugins.inc
- '
- ' Contents:
- '
- '--------------------------------------------------------------------------
-
- Dim g_objPluginCollection
- Dim g_objPlugin
- Dim g_objPluginAdmin
- Dim g_strPluginName
-
- Dim g_strCategory
- Dim g_strSubCategory
- Dim g_strPluginIndexInCategory
- Dim g_strEncodedInstance
- Dim g_strDecodedInstance
- Dim g_dwPluginCount
-
- dwTabIndex = 1
-
- ConnectToServer
- ConnectToPubPoint
-
- g_objPluginCollection = empty
- g_objPlugin = empty
- g_objPluginAdmin = empty
- g_strPluginName = empty
-
- g_strEncodedInstance = GetPostOrQsVal( "instance" )
- g_strDecodedInstance = SafeUnescape( g_strEncodedInstance )
- g_strCategory = GetPostOrQsVal( "category" )
- g_strReferrer = GetPostOrQsVal( "referrer" )
-
- '///////////////////////////
- Function GetFormStr( strKey )
- GetFormStr = trim( CStr( posting( strKey ) ) )
- End Function
-
- '///////////////////////////
- Function GetFormDbl( strKey )
- Dim strTmp
- strTmp = trim( CStr( posting( strKey ) ) )
- if( 0 < Len( strTmp ) ) then
- GetFormDbl = CDbl( strTmp )
- else
- GetFormDbl = 0
- end if
- End Function
-
- '///////////////////////////
- Function GetPostOrQsVal( strKey )
-
- Dim strVal
- strVal = CStr( posting( strKey ) )
-
- if( 0 = Len( strVal ) ) then
- strVal = CStr( qs( strKey ) )
- end if
-
- GetPostOrQsVal = strVal
-
- End Function
-
- '///////////////////////////
- Sub ConnectToPlugin
- '
- ' If it looks like we're connecting to a particular publishing point, then
- ' assign objPubPointOrServer to the pub point
- '
- Dim objPubPointOrServer
- Set objPubPointOrServer = g_objServer
- if( FALSE = IsEmpty( g_objPubPoint ) ) then
- Set objPubPointOrServer = g_objPubPoint
- end if
-
- Select Case g_strCategory
- case CAT_AUTHORIZE
- Set g_objPluginCollection = objPubPointOrServer.EventHandlers
- g_strSubCategory = AUTHORIZE_SUBCAT
- case CAT_LOGGING
- Set g_objPluginCollection = objPubPointOrServer.EventHandlers
- g_strSubCategory = LOGGING_SUBCAT
- case CAT_EVENT
- Set g_objPluginCollection = objPubPointOrServer.EventHandlers
- case CAT_AUTHEN
- Set g_objPluginCollection = objPubPointOrServer.Authenticators
- case CAT_CPROT
- Set g_objPluginCollection = objPubPointOrServer.ControlProtocols
- case CAT_PLAYXFORM
- Set g_objPluginCollection = objPubPointOrServer.EventHandlers
- g_strSubCategory = PLAYLISTXFORM_SUBCAT
- case CAT_MPARS
- Set g_objPluginCollection = objPubPointOrServer.MediaParsers
- case CAT_PLPARS
- Set g_objPluginCollection = objPubPointOrServer.PlaylistParsers
- case CAT_DSRC
- Set g_objPluginCollection = objPubPointOrServer.DataSources
- case CAT_CACHE
- Set g_objPluginCollection = objPubPointOrServer.CacheProxy
- case CAT_ARCH
- Set g_objPluginCollection = objPubPointOrServer.BroadcastDataSinks
- g_strSubCategory = ARCHIVER_SUBCAT
- case CAT_UCAST
- Set g_objPluginCollection = objPubPointOrServer.UnicastDataSinks
- case CAT_MCAST
- if objPubPointOrServer.name = g_objServer.name then
- Set g_objPluginCollection = objPubPointOrServer.UnicastDataSinks
- else
- Set g_objPluginCollection = objPubPointOrServer.BroadcastDataSinks
- g_strSubCategory = MULTICAST_SUBCAT
- end if
- case Else
- g_strCategory = L_UNKNOWN_TEXT
- g_strSubCategory = L_UNKNOWN_TEXT
- End Select
-
- if( FALSE = IsEmpty( g_objPluginCollection ) ) then
- g_dwPluginCount = g_objPluginCollection.Count
- else
- g_dwPluginCount = 0
- end if
-
- if( 0 < g_dwPluginCount ) then
- strPluginIndex = qs( "pluginIndex" )
- g_strPluginIndexInCategory = Right( strPluginIndex, Len( strPluginIndex ) - 8 + 1 )
- Set g_objPlugin = g_objPluginCollection( g_strPluginIndexInCategory )
- g_strDecodedInstance = g_objPlugin.Name
- g_strEncodedInstance = SafeEscape( g_strDecodedInstance )
- end if
-
- if( empty <> g_objPlugin ) then
- g_strPluginName = g_objPlugin.Name
- else
- g_strPluginName = "??"
- end if
- end Sub
-
-
- '///////////////////////////
- Sub ConnectToPluginAdmin()
- on error resume next
-
- if( TRUE = IsEmpty( g_objPlugin ) ) then
- ConnectToPlugin
- end if
-
- if( FALSE = IsEmpty( g_objPlugin ) ) then
- Set g_objPluginAdmin = g_objPlugin.CustomInterface
- end if
- End Sub
-
-
- '///////////////////////////
- Sub WritePluginJSUtils()
- Dim strEncodedPluginName
- Dim strExtraArgs
- strExtraArgs = ""
- strEncodedPluginName = SafeEscape( g_strPluginName )
- if( 0 < Len( GetPostOrQsVal("pendingOp") ) ) then
- strExtraArgs = "&pendingOp=" & GetPostOrQsVal( "pendingOp" )
- end if
- %>
- <script language="JavaScript" src="include/WMSCommon.js"></script>
- <script language="JavaScript">
- <!--
- /*@cc_on @*/
-
- var g_bSubmittedForm = false;
-
- <% WriteCommonJSUtils %>
-
- ///////////////////////////
- function DoPluginHelp( szHelpTopic )
- {
- <% jsTRY %>
- DoHelp( "/", szHelpTopic );
- <% jsCATCH %>
- }
-
- ///////////////////////////
- function ValidateInput()
- {
- <% jsTRY %>
- if( true == g_bSubmittedForm )
- {
- <% if( brMSIE = g_dwBrowserType ) then %>
- if( window.event )
- {
- window.event.cancelBubble = true;
- }
- <% end if %>
- document.pluginForm.ok.disabled = true;
- return( false );
- }
-
- if( document.pluginForm.ok.disabled )
- {
- <% if( brMSIE = g_dwBrowserType ) then %>
- event.cancelBubble = true;
- <% end if %>
- return( false );
- }
-
- g_bSubmittedForm = true;
- return( true );
- <% jsCATCH %>
- }
-
- ///////////////////////////
- function Cancel()
- {
- <% jsTRY %>
- <% if 0 < Len( g_strReferrer ) then %>
- document.location = "<%= URLDecode( SafeUnescape( g_strReferrer ) ) %>?server=<%= g_strQueryStringServer %>&ppID=<%= g_strPubPointID %>&category=<%= g_strCategory %>&pluginIndex=plugin_<%= g_strPluginIndexInCategory %>&instance=<%= strEncodedPluginName %><%= strExtraArgs %>";
- <% elseif 0 < Len( g_strPubPointName ) then %>
- document.location = "../pubpoints/pubpoint_props.asp?server=<%= g_strQueryStringServer %>&ppID=<%= g_strPubPointID %>&category=<%= g_strCategory %>&pluginIndex=plugin_<%= g_strPluginIndexInCategory %>&instance=<%= strEncodedPluginName %><%= strExtraArgs %>";
- <% else %>
- document.location = "../server_props.asp?server=<%= g_strQueryStringServer %>&category=<%= g_strCategory %>&pluginIndex=plugin_<%= g_strPluginIndexInCategory %>&instance=<%= strEncodedPluginName %><%= strExtraArgs %>";
- <% end if %>
- <% jsCATCH %>
- }
- -->
- </script>
- <%
- End Sub
-
- '///////////////////////////
- Sub WriteStdPluginForm()
- %>
- <form name="pluginForm" method="POST" action="<%= RemoveDangerousCharacters( g_strQueryString ) %>" onsubmit="JavaScript:window.status='';return( ValidateInput() );" AUTOCOMPLETE="OFF">
- <input type="hidden" name="server" value="<%= RemoveSpecifiedChars( g_strQueryStringServer, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="ppID" value="<%= RemoveSpecifiedChars( g_strPubPointID, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="category" value="<%= RemoveSpecifiedChars( g_strCategory, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="pluginIndex" value="plugin_<%= RemoveSpecifiedChars( g_strPluginIndexInCategory, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="instance" value="<%= RemoveSpecifiedChars( g_strDecodedInstance, "\f|\n|\r|<|>" ) %>">
- <input type="hidden" name="referrer" value="<%= RemoveSpecifiedChars( g_strReferrer, "\f|\n|\r|<|>" ) %>"><%
- if 0 < Len( GetPostOrQsVal("pendingOp") ) then %>
- <input type="hidden" name="pendingOp" value="<%= RemoveSpecifiedChars( GetPostOrQsVal("pendingOp"), "\f|\n|\r|<|>" ) %>"><%
- end if %>
- <input type="hidden" name="submit" value="apply">
- <%
- End Sub
-
- '///////////////////////////
- '
- ' Free the various globals we created by server-side-including this file
- '
- Sub PluginsASPCleanup
- on error resume next
- WMSConnectASPCleanup
-
- g_objPluginCollection = nothing
- g_objPlugin = nothing
- g_objPluginAdmin = nothing
- g_strPluginName = nothing
-
- g_strCategory = nothing
- g_strSubCategory = nothing
- g_strPluginIndexInCategory = nothing
- g_strEncodedInstance = nothing
- g_strDecodedInstance = nothing
- g_dwPluginCount = nothing
- End Sub
- %>
-